//
//  UiView+Extension.swift
//  Weibo
//
//  Created by HH on 16/11/30.
//  Copyright © 2016年 Weibo. All rights reserved.
//

import UIKit

extension UIView {
    
    //MARK:X
    var x:CGFloat{
        
        get{
            return self.frame.origin.x
        }
        
        set{
            self.frame.origin.x = newValue
        }
    }
    
    //MARK:Y
    var y:CGFloat{
        
        get{
            return self.frame.origin.y
        }
        
        set{
            self.frame.origin.y = newValue
        }
    }
    
    //MARK:width
    var width:CGFloat{
        get{
            return self.frame.size.width
        }
        
        set{
            self.frame.size.width = newValue
        }
    }
    
    
    //MARK:height
    var height:CGFloat{
        get{
            return self.frame.size.height
        }
        
        set{
            self.frame.size.height = newValue
        }
    }
    
    
    //MARK:size
    var size:CGSize{
        get{
            return self.frame.size
        }
        
        set{
            self.frame.size = newValue
        }
    }
    
    
    //MARK:centerX
    var centerX:CGFloat{
        get{
            return self.center.x
        }
        
        set{
            self.center.x = newValue
        }
    }
    
    
    //MARK:centerY
    var centerY:CGFloat{
        get{
            return self.center.y
        }
        
        set{
            self.center.y = newValue
        }
    }
    
    
}
